package com.whoru.app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;

public class SplashActivity extends Activity {
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         
         requestWindowFeature(Window.FEATURE_NO_TITLE);
         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                              WindowManager.LayoutParams.FLAG_FULLSCREEN);
         
         LinearLayout ll = new LinearLayout(this);
         ll.setBackgroundDrawable(
         getResources().getDrawable(R.drawable.team));
        
         ll.setOrientation(LinearLayout.VERTICAL);
         ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
         ll.setGravity(Gravity.CENTER);
         setContentView(ll);
         
         Thread splashThread = new Thread() {
        	  @Override
        	  public void run() {
        	try {
        	         int waited = 0;
        	         while (waited < 5000) {
        	            sleep(100);
        	            waited += 100;
        	}
        	} catch (InterruptedException e) {
        		               // do nothing
        	} finally {
        	            finish();
        	            Intent i = new Intent();
        	i.setClassName("com.whoru.app",
        		                   "com.whoru.app.Login");
        		    startActivity(i);
        	}
        	  }
        	};

        	splashThread.start();
     }
}